package com.group6.exam.manager.servlet;

import java.io.IOException;
import java.util.List;
import java.util.Map;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.group6.exam.manager.service.IUserRoleService;
import com.group6.exam.manager.service.UserRoleServiceImpl;

public class UserRoleServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;

	protected void doGet(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		doPost(request, response);
	}

	protected void doPost(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		IUserRoleService roleService = new UserRoleServiceImpl();
		List<Map<String, Object>> roleList = roleService.getRole();

		request.setAttribute("roleList", roleList);
		request.getRequestDispatcher("/view/manager/user/sys_adduser.jsp")
				.forward(request, response);
	}

}
